package com.daixu.xutil.demo.activity;

import android.os.Bundle;

import com.daixu.xutil.demo.BaseActivity;
import com.daixu.xutil.demo.R;

import org.xutils.view.annotation.ContentView;

import java.io.IOException;

import pl.droidsonroids.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView;

/**
 * Created by yangbo on 2016/2/18.
 */
@ContentView(R.layout.activity_gif)
public class GifActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        String img = "http://img0.ph.126.net/uj1RFk7mKbF9Ve-uAV5SAw==/2673167853921119283.gif";
        try {
//            GifDrawable g = new GifDrawable(img);
            GifDrawable g = new GifDrawable(getResources(), R.mipmap.testgif);
            GifImageView iv = (GifImageView) findViewById(R.id.image_gif);
            iv.setImageDrawable(g);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
